package main

import "fmt"

func main() {
	/*
		求两个3*3矩阵的和并输出（数据都是int类型）
		解析：矩阵的和计算规则是对应元素相加：
		c[i][j] = a[i][j] + b[i][j]
	*/
	arr1 := [3][3]int{{1, 2, 3}, {5, 6, 7}, {3, 7, 9}}
	arr2 := [3][3]int{{12, 32, 13}, {15, 16, 17}, {9, 9, 9}}
	var arr3 [3][3]int
	// i => 行，j=>列
	for i := 0; i < 3; i++ {
		for j := 0; j < 3; j++ {
			arr3[i][j] = arr1[i][j] + arr2[i][j]
		}
	}
	fmt.Println(arr3)
}
